<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCheckScoresTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('check_scores', function (Blueprint $table) {
//            $table->comment('学年考核评分表');
            $table->increments('id');
            $table->integer('check_id')->index('check_id_index');
            $table->integer('ct_id')->index('ct_id_index');
            $table->float('scores', 5, 1)->comment('总分');
            $table->float('average_score', 5)->comment('平均分');
            $table->text('scores_detail')->comment('评分详情');
            $table->boolean('level')->default(false)->comment('被评人职称档次 0-无 1-优 2-合格 3-基本合格 4-不合格');
            $table->integer('author_id')->comment('评分人id');
            $table->timestamps();
            $table->boolean('mark_scores')->default(false)->comment('0-(历史数据) 1-已打分 （复用功能之后新增字段）');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('check_scores');
    }
};
